package com.tdwyz.fictionmanage.enums;

public enum FileType {
    //头像
    AVATAR(0),
    //封面
    COVER(1);

    private Integer state;

    FileType(Integer state){
        this.state = state;
    }

    public Integer getState() {
        return state;
    }

    /**
     * 判断文件状态
     * @param state
     * @return
     */
    public static boolean contains(Integer state){
        for (FileType value : FileType.values()) {
            //当前遍历的状态与用户传入的状态是否一致
            if (value.getState().equals(state)){
                return true;
            }
        }
        return false;
    }
}
